package com.huanuo.internetofthings.service.impact;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.unicorn.framework.base.base.AbstractService;
import org.unicorn.framework.core.SysCode;
import org.unicorn.framework.core.exception.PendingException;

import com.huanuo.internetofthings.bo.impact.ImpactGroup;
import com.huanuo.internetofthings.dao.impact.ImpactGroupMapper;

@Service
public class ImpactGroupService extends AbstractService {

	@Autowired
	private ImpactGroupMapper impactGroupMapper;

	public List<ImpactGroup> getImpactGroupList(ImpactGroup impactGroup) throws PendingException {
		try {
			return impactGroupMapper.selectList(impactGroup);
		} catch (Exception e) {
			error("查询组列表失败", e);
			throw new PendingException(SysCode.DB_ERROR, "查询组列表失败");
		}
	}
	public ImpactGroup getImpactGroup(ImpactGroup impactGroup) throws PendingException {
		try {
			return impactGroupMapper.selectOne(impactGroup);
		} catch (Exception e) {
			error("查询用户权限组失败", e);
			throw new PendingException(SysCode.DB_ERROR, "查询用户权限组失败");
		}
	}
}